<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      lang="en"
      metal:use-macro="here/main_template/macros/master"
      i18n:domain="inquant.portlet.contextualrecentitems">

      <metal:block fill-slot="top_slot"
                   tal:define="dummy python:request.set('disable_border', 1)" />

<body>

<div metal:fill-slot="main"
    tal:define="results python:container.portal_catalog(portal_type=request.get('type'), sort_on='modified',sort_order='reverse');
                 Batch python:modules['Products.CMFPlone'].Batch;
                 DateTime python:modules['DateTime'].DateTime;
                 b_start python:request.get('b_start',0);">

    <h1 class="documentFirstHeading"
        i18n:translate="heading_recently_modified">
        Modified items
    </h1>

    <div i18n:translate="description_recently_modified" class="documentDescription">
        All recently modified items, latest first.
    </div>

    <form name="searchresults" action="" method="post" tal:condition="results"
                      tal:define="batch python:Batch(results, 20, int(b_start), orphan=1)">

        <tal:results tal:repeat="result batch">

            <dl>
                <dt tal:define="item_icon python:plone_view.getIcon(result);
                                item_wf_state result/review_state;
                                item_wf_state_class python:'state-' + normalizeString(item_wf_state);">
                    <span tal:attributes="class python:'contenttype-' + normalizeString(result.portal_type)">
                      <img tal:replace="structure item_icon/html_tag" />
                      <a href="/view"
                         tal:content="result/pretty_title_or_id"
                         tal:attributes="href result/getURL;
                                         class string:$item_wf_state_class">
                      Title
                      </a>
                    </span>

                    <span class="discreet" i18n:translate="text_creator_date">
                        by
                        <span tal:define="creator result/Creator;
                                          author python:mtool.getMemberInfo(creator)"
                              tal:content="python:author and author['fullname'] or creator"
                              tal:omit-tag=""
                              i18n:name="creator">creator</span>,
                        last updated:
                        <span tal:content="python:toLocalizedTime(result.ModificationDate, long_format=1)"
                              tal:omit-tag=""
                              i18n:name="date">date</span>
                    </span>
                </dt>

                <dd tal:content="result/Description">
                    Description
                </dd>
            </dl>

        </tal:results>

        <div class="spacer">
        &nbsp;
        </div>

        <!-- Navigation -->
        <div metal:use-macro="here/batch_macros/macros/navigation" />

        </form>

    <p tal:condition="not: results" i18n:translate="text_no_new_modified_items">
        No items have been modified.
    </p>

  </div>

</body>

</html>

<!-- vim: set ft=html ts=2 sw=2 expandtab : -->
